package cn.easybuy.dao;

import cn.easybuy.pojo.News;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NewsMapper extends BaseMapper<News> {

    /**
     * 根据最新时间来查询新闻(5)
     * @param wrapper
     * @return
     */
    @Select("select * from easybuy_news order by createTime desc limit 5 " +
            "${ew.customSqlSegment}")
    List<News> selectNewsList(@Param(Constants.WRAPPER) Wrapper<News> wrapper);
}
